Skip to content

fix: isClass for minified class expression#64

Merged
thetutlage merged 1 commit intoadonisjs:11.xfrom
tgriesser:tgriesser/fix/is-class-fix
Nov 3, 2025
Merged

fix: isClass for minified class expression#64
thetutlage merged 1 commit intoadonisjs:11.xfrom
tgriesser:tgriesser/fix/is-class-fix

Conversation

@tgriesser
Copy link
Contributor

🔗 Linked issue

N/A

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Related change in sindresorhus/is#217, several of the Adonis packages seem to be using.

I was experimenting recently with bundling the Adonis codebase via ESBuild, and everything seemed to work. However when I minified the code, it broke in a strange way. It seemed to be due to the minification creating a class expression with class{}, which isClass did not evaluate true for.

It seems the other packages are now using @sindresorhus/is, however this one still has the standalone isClass helper, so this is just adding my change from that repo here.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@thetutlage thetutlage merged commit 8eba7f4 into adonisjs:11.x Nov 3, 2025
4 checks passed
@thetutlage
Copy link
Member

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants